//
//  RightViewController.m
//  Commerce
//
//  Created by xiaofeifei on 15/2/1.
//  Copyright (c) 2015年 fei. All rights reserved.
//

#import "RightViewController.h"
#import "LoginViewController.h"

@interface RightViewController (){
    AppDelegate *app;
}

@end

@implementation RightViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)gotoLoginView{
    UINavigationController *menuController = (UINavigationController*)((AppDelegate*)[[UIApplication sharedApplication] delegate]).menuController;
    
    LoginViewController *vc = [[LoginViewController alloc] initWithNibName:nil bundle:nil];
    [menuController pushViewController:vc animated:YES];
}

#pragma mark -请求接口
- (void)getRightMenu{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSMutableDictionary *parameters = [GlobalData paramterDic];
    NSLog(@"%@",parameters);
    [manager POST:[NSString stringWithFormat:@"%@sys/rightmenu",URL_ROOT] parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"responseObject=%@",responseObject);
        //        if ([responseObject[@"result"] intValue]==0) {
        //            [self getCode];
        //        }else{
        //            [SVProgressHUD showInfoWithStatus:@"此号码已注册"];
        //        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
        [SVProgressHUD showInfoWithStatus:error.domain];
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
